<?php
require_once ('../libs/Smarty.class.php');

$smarty = new Smarty ();

//$smarty->force_compile = true;
$smarty->debugging = true;
$smarty->caching = false;
//$smarty->cache_lifetime = 120;
require_once '../util/auth.php';
if (isLoggedIn ()) {
	if (isset ( $_POST ["t"] )) {
		// tid given
		$smarty->assign("username", $_SESSION["username"]);
		$tid = $_POST ["t"];
		$path = sprintf('test_logic/t%s.php', $tid);
		require_once $path;
		displayTestResult($smarty, $_POST);
		
	} else {
		// No tid given
		die ( 'No tid(?t=%d) given' );
	}
} else {
	header ( 'Location: /cpanel/login.php' );
}

